Nikita.tkachenko/runtime code coverage#10951
Draft
nikita-tkachenko-datadog wants to merge 11 commits intomasterfrom
Draft
Nikita.tkachenko/runtime code coverage#10951nikita-tkachenko-datadog wants to merge 11 commits intomasterfrom
nikita-tkachenko-datadog wants to merge 11 commits intomasterfrom
Conversation
Implement Coverage Binary Protocol v1 (CoverageBinaryEncoder) using two bit vectors per record for executable and covered lines. Switch from LCOV text format to the new "ddcov" binary format for coverage uploads. Add className to ClassProbeMapping, key coverage data by CoverageKey (sourceFile + className), and include language/env tags in upload metadata. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 63 metrics, 8 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.61.0-SNAPSHOT~9e26d80b45, baseline=1.61.0-SNAPSHOT~fd087771cb
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.072 s) : 0, 1071500
Total [baseline] (8.922 s) : 0, 8922414
Agent [candidate] (1.057 s) : 0, 1056823
Total [candidate] (8.845 s) : 0, 8844546
section iast
Agent [baseline] (1.231 s) : 0, 1230785
Total [baseline] (9.594 s) : 0, 9594292
Agent [candidate] (1.231 s) : 0, 1230833
Total [candidate] (9.553 s) : 0, 9552610
gantt
title insecure-bank - break down per module: candidate=1.61.0-SNAPSHOT~9e26d80b45, baseline=1.61.0-SNAPSHOT~fd087771cb
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.238 ms) : 0, 1238
crashtracking [candidate] (1.221 ms) : 0, 1221
BytebuddyAgent [baseline] (637.527 ms) : 0, 637527
BytebuddyAgent [candidate] (618.023 ms) : 0, 618023
AgentMeter [baseline] (29.96 ms) : 0, 29960
AgentMeter [candidate] (29.366 ms) : 0, 29366
GlobalTracer [baseline] (259.946 ms) : 0, 259946
GlobalTracer [candidate] (256.932 ms) : 0, 256932
AppSec [baseline] (32.231 ms) : 0, 32231
AppSec [candidate] (31.666 ms) : 0, 31666
Debugger [baseline] (60.359 ms) : 0, 60359
Debugger [candidate] (59.501 ms) : 0, 59501
Remote Config [baseline] (596.378 µs) : 0, 596
Remote Config [candidate] (595.172 µs) : 0, 595
Telemetry [baseline] (8.117 ms) : 0, 8117
Telemetry [candidate] (8.168 ms) : 0, 8168
Flare Poller [baseline] (5.078 ms) : 0, 5078
Flare Poller [candidate] (5.053 ms) : 0, 5053
section iast
crashtracking [baseline] (1.204 ms) : 0, 1204
crashtracking [candidate] (1.228 ms) : 0, 1228
BytebuddyAgent [baseline] (797.86 ms) : 0, 797860
BytebuddyAgent [candidate] (788.579 ms) : 0, 788579
AgentMeter [baseline] (11.428 ms) : 0, 11428
AgentMeter [candidate] (11.618 ms) : 0, 11618
GlobalTracer [baseline] (248.165 ms) : 0, 248165
GlobalTracer [candidate] (247.249 ms) : 0, 247249
AppSec [baseline] (26.577 ms) : 0, 26577
AppSec [candidate] (26.753 ms) : 0, 26753
Debugger [baseline] (69.378 ms) : 0, 69378
Debugger [candidate] (66.137 ms) : 0, 66137
Remote Config [baseline] (533.45 µs) : 0, 533
Remote Config [candidate] (523.28 µs) : 0, 523
Telemetry [baseline] (10.425 ms) : 0, 10425
Telemetry [candidate] (12.288 ms) : 0, 12288
Flare Poller [baseline] (3.579 ms) : 0, 3579
Flare Poller [candidate] (4.257 ms) : 0, 4257
IAST [baseline] (25.419 ms) : 0, 25419
IAST [candidate] (25.544 ms) : 0, 25544
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.61.0-SNAPSHOT~9e26d80b45, baseline=1.61.0-SNAPSHOT~fd087771cb
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.057 s) : 0, 1056795
Total [baseline] (11.117 s) : 0, 11116771
Agent [candidate] (1.054 s) : 0, 1054055
Total [candidate] (11.002 s) : 0, 11002119
section appsec
Agent [baseline] (1.247 s) : 0, 1246652
Total [baseline] (11.189 s) : 0, 11189209
Agent [candidate] (1.244 s) : 0, 1243917
Total [candidate] (11.288 s) : 0, 11287839
section iast
Agent [baseline] (1.231 s) : 0, 1231092
Total [baseline] (11.264 s) : 0, 11263624
Agent [candidate] (1.233 s) : 0, 1233320
Total [candidate] (11.362 s) : 0, 11361973
section profiling
Agent [baseline] (1.183 s) : 0, 1182695
Total [baseline] (10.971 s) : 0, 10970829
Agent [candidate] (1.183 s) : 0, 1183077
Total [candidate] (11.003 s) : 0, 11002579
gantt
title petclinic - break down per module: candidate=1.61.0-SNAPSHOT~9e26d80b45, baseline=1.61.0-SNAPSHOT~fd087771cb
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.192 ms) : 0, 1192
crashtracking [candidate] (1.228 ms) : 0, 1228
BytebuddyAgent [baseline] (628.607 ms) : 0, 628607
BytebuddyAgent [candidate] (616.663 ms) : 0, 616663
AgentMeter [baseline] (29.478 ms) : 0, 29478
AgentMeter [candidate] (29.3 ms) : 0, 29300
GlobalTracer [baseline] (257.214 ms) : 0, 257214
GlobalTracer [candidate] (256.451 ms) : 0, 256451
AppSec [baseline] (31.773 ms) : 0, 31773
AppSec [candidate] (31.558 ms) : 0, 31558
Debugger [baseline] (60.24 ms) : 0, 60240
Debugger [candidate] (60.404 ms) : 0, 60404
Remote Config [baseline] (587.89 µs) : 0, 588
Remote Config [candidate] (599.863 µs) : 0, 600
Telemetry [baseline] (8.038 ms) : 0, 8038
Telemetry [candidate] (8.214 ms) : 0, 8214
Flare Poller [baseline] (3.527 ms) : 0, 3527
Flare Poller [candidate] (3.508 ms) : 0, 3508
section appsec
crashtracking [baseline] (1.2 ms) : 0, 1200
crashtracking [candidate] (1.205 ms) : 0, 1205
BytebuddyAgent [baseline] (657.701 ms) : 0, 657701
BytebuddyAgent [candidate] (645.745 ms) : 0, 645745
AgentMeter [baseline] (12.085 ms) : 0, 12085
AgentMeter [candidate] (12.088 ms) : 0, 12088
GlobalTracer [baseline] (258.073 ms) : 0, 258073
GlobalTracer [candidate] (257.744 ms) : 0, 257744
AppSec [baseline] (177.997 ms) : 0, 177997
AppSec [candidate] (177.706 ms) : 0, 177706
Debugger [baseline] (66.541 ms) : 0, 66541
Debugger [candidate] (66.063 ms) : 0, 66063
Remote Config [baseline] (627.784 µs) : 0, 628
Remote Config [candidate] (644.03 µs) : 0, 644
Telemetry [baseline] (8.429 ms) : 0, 8429
Telemetry [candidate] (8.407 ms) : 0, 8407
Flare Poller [baseline] (3.581 ms) : 0, 3581
Flare Poller [candidate] (3.624 ms) : 0, 3624
IAST [baseline] (24.11 ms) : 0, 24110
IAST [candidate] (24.143 ms) : 0, 24143
section iast
crashtracking [baseline] (1.216 ms) : 0, 1216
crashtracking [candidate] (1.2 ms) : 0, 1200
BytebuddyAgent [baseline] (800.388 ms) : 0, 800388
BytebuddyAgent [candidate] (789.208 ms) : 0, 789208
AgentMeter [baseline] (11.589 ms) : 0, 11589
AgentMeter [candidate] (11.659 ms) : 0, 11659
GlobalTracer [baseline] (246.799 ms) : 0, 246799
GlobalTracer [candidate] (248.119 ms) : 0, 248119
AppSec [baseline] (26.46 ms) : 0, 26460
AppSec [candidate] (26.7 ms) : 0, 26700
Debugger [baseline] (70.224 ms) : 0, 70224
Debugger [candidate] (68.936 ms) : 0, 68936
Remote Config [baseline] (534.302 µs) : 0, 534
Remote Config [candidate] (528.831 µs) : 0, 529
Telemetry [baseline] (9.095 ms) : 0, 9095
Telemetry [candidate] (11.04 ms) : 0, 11040
Flare Poller [baseline] (3.314 ms) : 0, 3314
Flare Poller [candidate] (3.757 ms) : 0, 3757
IAST [baseline] (25.224 ms) : 0, 25224
IAST [candidate] (25.499 ms) : 0, 25499
section profiling
crashtracking [baseline] (1.18 ms) : 0, 1180
crashtracking [candidate] (1.181 ms) : 0, 1181
BytebuddyAgent [baseline] (682.206 ms) : 0, 682206
BytebuddyAgent [candidate] (682.645 ms) : 0, 682645
AgentMeter [baseline] (9.045 ms) : 0, 9045
AgentMeter [candidate] (9.057 ms) : 0, 9057
GlobalTracer [baseline] (214.9 ms) : 0, 214900
GlobalTracer [candidate] (215.519 ms) : 0, 215519
AppSec [baseline] (32.193 ms) : 0, 32193
AppSec [candidate] (32.279 ms) : 0, 32279
Debugger [baseline] (64.914 ms) : 0, 64914
Debugger [candidate] (65.832 ms) : 0, 65832
Remote Config [baseline] (572.635 µs) : 0, 573
Remote Config [candidate] (553.301 µs) : 0, 553
Telemetry [baseline] (8.515 ms) : 0, 8515
Telemetry [candidate] (7.665 ms) : 0, 7665
Flare Poller [baseline] (3.509 ms) : 0, 3509
Flare Poller [candidate] (3.444 ms) : 0, 3444
ProfilingAgent [baseline] (94.712 ms) : 0, 94712
ProfilingAgent [candidate] (93.757 ms) : 0, 93757
Profiling [baseline] (95.281 ms) : 0, 95281
Profiling [candidate] (94.312 ms) : 0, 94312
LoadParameters
See matching parameters
SummaryFound 2 performance improvements and 0 performance regressions! Performance is the same for 15 metrics, 19 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~9e26d80b45, baseline=1.61.0-SNAPSHOT~fd087771cb
dateFormat X
axisFormat %s
section baseline
no_agent (18.819 ms) : 18623, 19014
. : milestone, 18819,
appsec (19.109 ms) : 18915, 19303
. : milestone, 19109,
code_origins (17.682 ms) : 17508, 17856
. : milestone, 17682,
iast (18.576 ms) : 18388, 18763
. : milestone, 18576,
profiling (18.979 ms) : 18788, 19170
. : milestone, 18979,
tracing (18.566 ms) : 18379, 18754
. : milestone, 18566,
section candidate
no_agent (17.871 ms) : 17686, 18055
. : milestone, 17871,
appsec (18.249 ms) : 18063, 18435
. : milestone, 18249,
code_origins (17.78 ms) : 17602, 17957
. : milestone, 17780,
iast (18.544 ms) : 18355, 18732
. : milestone, 18544,
profiling (18.693 ms) : 18505, 18881
. : milestone, 18693,
tracing (17.853 ms) : 17674, 18033
. : milestone, 17853,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~9e26d80b45, baseline=1.61.0-SNAPSHOT~fd087771cb
dateFormat X
axisFormat %s
section baseline
no_agent (1.184 ms) : 1172, 1195
. : milestone, 1184,
iast (3.347 ms) : 3298, 3395
. : milestone, 3347,
iast_FULL (5.771 ms) : 5713, 5829
. : milestone, 5771,
iast_GLOBAL (3.436 ms) : 3388, 3483
. : milestone, 3436,
profiling (2.026 ms) : 2008, 2043
. : milestone, 2026,
tracing (1.763 ms) : 1748, 1778
. : milestone, 1763,
section candidate
no_agent (1.175 ms) : 1164, 1187
. : milestone, 1175,
iast (3.248 ms) : 3209, 3288
. : milestone, 3248,
iast_FULL (5.957 ms) : 5896, 6018
. : milestone, 5957,
iast_GLOBAL (3.555 ms) : 3496, 3615
. : milestone, 3555,
profiling (2.231 ms) : 2210, 2252
. : milestone, 2231,
tracing (1.775 ms) : 1760, 1791
. : milestone, 1775,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~9e26d80b45, baseline=1.61.0-SNAPSHOT~fd087771cb
dateFormat X
axisFormat %s
section baseline
no_agent (1.481 ms) : 1469, 1492
. : milestone, 1481,
appsec (2.518 ms) : 2464, 2572
. : milestone, 2518,
iast (2.276 ms) : 2207, 2345
. : milestone, 2276,
iast_GLOBAL (2.322 ms) : 2252, 2391
. : milestone, 2322,
profiling (2.111 ms) : 2055, 2168
. : milestone, 2111,
tracing (2.076 ms) : 2022, 2129
. : milestone, 2076,
section candidate
no_agent (1.482 ms) : 1470, 1493
. : milestone, 1482,
appsec (3.791 ms) : 3570, 4012
. : milestone, 3791,
iast (2.273 ms) : 2204, 2342
. : milestone, 2273,
iast_GLOBAL (2.312 ms) : 2243, 2382
. : milestone, 2312,
profiling (2.1 ms) : 2044, 2156
. : milestone, 2100,
tracing (2.073 ms) : 2019, 2126
. : milestone, 2073,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~9e26d80b45, baseline=1.61.0-SNAPSHOT~fd087771cb
dateFormat X
axisFormat %s
section baseline
no_agent (14.924 s) : 14924000, 14924000
. : milestone, 14924000,
appsec (14.591 s) : 14591000, 14591000
. : milestone, 14591000,
iast (17.943 s) : 17943000, 17943000
. : milestone, 17943000,
iast_GLOBAL (18.074 s) : 18074000, 18074000
. : milestone, 18074000,
profiling (14.969 s) : 14969000, 14969000
. : milestone, 14969000,
tracing (15.047 s) : 15047000, 15047000
. : milestone, 15047000,
section candidate
no_agent (15.447 s) : 15447000, 15447000
. : milestone, 15447000,
appsec (14.759 s) : 14759000, 14759000
. : milestone, 14759000,
iast (18.027 s) : 18027000, 18027000
. : milestone, 18027000,
iast_GLOBAL (17.739 s) : 17739000, 17739000
. : milestone, 17739000,
profiling (14.78 s) : 14780000, 14780000
. : milestone, 14780000,
tracing (15.018 s) : 15018000, 15018000
. : milestone, 15018000,
|
`new int[probeCount][]` creates an array of null references. When the collector iterates `probeToLines[p]`, it NPEs on classes that have probes but no executable lines (no debug info, interfaces). Initialize each entry to `new int[0]` instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Skip classes without a SourceFile attribute in the collector to prevent NPE in the binary encoder (null is not a valid string in the coverage binary protocol) - Log instrumentation failures at debug level so they are visible when troubleshooting Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ClassProbeMappingBuilder previously ran JaCoCo's Analyzer N+1 times per class (once per probe + once for executable lines). For a class with 200 probes, that meant 201 full ASM parses of the same bytecode. The new implementation parses the class once using ClassProbesAdapter, builds a simplified instruction graph (ProbeNode with predecessor links), and walks predecessor chains to determine which lines each probe covers. ~200x faster for large classes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… scan On cache miss, try ClassLoader.getResourceAsStream() first (O(1) per class) before scanning all classpath jars/directories. Uses the system classloader (application classpath) first, then context classloader. CRC64 is verified after reading to ensure bytes match what was instrumented. Falls back to full classpath scan for any classes the classloader can't resolve. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace custom ScheduledExecutorService with a dedicated AgentTaskScheduler(CODE_COVERAGE) instance, following the same pattern as Profiler, Debugger, Remote Config, and Tracer Flare. This gives us proper daemon thread in the dd-trace-java thread group, null context classloader, uncaught exception handler, and shutdown hook handling for free. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Does This Do
Motivation
Additional Notes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]
Note: Once your PR is ready to merge, add it to the merge queue by commenting
/merge./merge -ccancels the queue request./merge -f --reason "reason"skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.